package org.pray.reversedep;

import java.util.HashMap;
import java.util.concurrent.TimeUnit;

/**
 * @author Rainy-Heights
 */
public class TestSingle {
    /**
     */
    private static volatile int a = 0;

    public static void main(String[] args) throws InterruptedException {
//        DependWithSingleMode depend = DependWithSingleMode.getInstance();
//        depend.methodWithAbstract();// 子类方法
//        System.out.println(depend.getInstanceTime());
//        TimeUnit.SECONDS.sleep(3);
//        DependWithSingleMode depend1=DependWithSingleMode.getInstance();
//        System.out.println(depend1.getInstanceTime());
//        long start = System.currentTimeMillis();
//
//        for (int i = 0; i < 100; i++) {
//            new Thread(()->{
//                //多线程场景下尝试用单线程创建
//                DependWithSingleMode dependWithSingleMode = DependWithSingleMode.getInstanceWithInnerClass();
//            }).start();
//        }
//        long end =System.currentTimeMillis();
//        System.out.println(end - start);
        HashMap<Integer,String> map=new HashMap<>();
        map.put(null,"nihao");
        System.out.printf("", map.get(null));
    }
}
